# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.FirebaseHosting.V1beta1.Model.DomainProvisioning do
  @moduledoc """
  The current certificate provisioning status information for a domain.

  ## Attributes

  *   `certChallengeDiscoveredTxt` (*type:* `list(String.t)`, *default:* `nil`) - The TXT records (for the certificate challenge) that were found at the last DNS fetch.
  *   `certChallengeDns` (*type:* `GoogleApi.FirebaseHosting.V1beta1.Model.CertDnsChallenge.t`, *default:* `nil`) - The DNS challenge for generating a certificate.
  *   `certChallengeHttp` (*type:* `GoogleApi.FirebaseHosting.V1beta1.Model.CertHttpChallenge.t`, *default:* `nil`) - The HTTP challenge for generating a certificate.
  *   `certStatus` (*type:* `String.t`, *default:* `nil`) - The certificate provisioning status; updated when Firebase Hosting provisions an SSL certificate for the domain.
  *   `discoveredIps` (*type:* `list(String.t)`, *default:* `nil`) - The IPs found at the last DNS fetch.
  *   `dnsFetchTime` (*type:* `DateTime.t`, *default:* `nil`) - The time at which the last DNS fetch occurred.
  *   `dnsStatus` (*type:* `String.t`, *default:* `nil`) - The DNS record match status as of the last DNS fetch.
  *   `expectedIps` (*type:* `list(String.t)`, *default:* `nil`) - The list of IPs to which the domain is expected to resolve.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :certChallengeDiscoveredTxt => list(String.t()) | nil,
          :certChallengeDns => GoogleApi.FirebaseHosting.V1beta1.Model.CertDnsChallenge.t() | nil,
          :certChallengeHttp =>
            GoogleApi.FirebaseHosting.V1beta1.Model.CertHttpChallenge.t() | nil,
          :certStatus => String.t() | nil,
          :discoveredIps => list(String.t()) | nil,
          :dnsFetchTime => DateTime.t() | nil,
          :dnsStatus => String.t() | nil,
          :expectedIps => list(String.t()) | nil
        }

  field(:certChallengeDiscoveredTxt, type: :list)
  field(:certChallengeDns, as: GoogleApi.FirebaseHosting.V1beta1.Model.CertDnsChallenge)
  field(:certChallengeHttp, as: GoogleApi.FirebaseHosting.V1beta1.Model.CertHttpChallenge)
  field(:certStatus)
  field(:discoveredIps, type: :list)
  field(:dnsFetchTime, as: DateTime)
  field(:dnsStatus)
  field(:expectedIps, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.FirebaseHosting.V1beta1.Model.DomainProvisioning do
  def decode(value, options) do
    GoogleApi.FirebaseHosting.V1beta1.Model.DomainProvisioning.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.FirebaseHosting.V1beta1.Model.DomainProvisioning do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
